feat(skills/opening-a-pull-request): document keyword and linkage semantics for stacked retargeted PRs#26
Merged
Conversation
…antics for stacked retargeted PRs
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the opening-a-pull-request skill to explicitly cover stacked, retargeted sub-PRs (drafts opened against a parent/sibling branch, then later retargeted to main) so agents apply consistent closing-keyword semantics and correctly interpret deferred GitHub issue linkage behavior.
Changes:
- Adds guidance for stacked sub-PRs that temporarily target a sibling branch, recommending using
Fixes/Closesfrom the start and explaining the “deferred until retarget” linkage behavior. - Adds a retarget-time verification step using
gh pr view --json closingIssuesReferencesand a re-save fallback if linkage doesn’t materialize. - Adds a red-flag row to prevent misdiagnosing “no linked PR” as an incorrect keyword while the PR is not yet based on the default branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… in the red-flag row's verification command The row's command omitted <num> while the body text includes it; without the number the command depends on the checked-out branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1vgUwZZpzavETACT3fXPM
…s in the stacked-PR bullet Matches the placeholder form the main-target bullet uses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1vgUwZZpzavETACT3fXPM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The skill's keyword table covers PRs targeting
mainand PRs targeting a feature branch, but not the stacked shape in thesub_pr_target: mainmodel: a draft that opens against its parent sub-branch (so its diff shows only its own commits) and retargets tomainwhen the parent merges. The silence forces every session to derive its own policy, and the two coherent derivations disagree — a baseline agent derivedTowardswith a manual upgrade at every retarget (whose forgotten upgrade means the sub-issue never auto-closes), while a live session usedClosesfrom the start and then had to diagnose why the epic's sub-issues showed no linked PR (the user asked; the answer — closing-keyword linkage only materializes on default-branch-base PRs — was nowhere in the skill).Change
skills/opening-a-pull-request/SKILL.mdgains a third branch-target bullet: use the type-appropriate closing keyword from the start (it describes the eventualmainmerge and survives the retarget with no body edit), with the deferral fact spelled out (no linked-PR association and no auto-close while the base is a sibling branch — deferred, not broken) and a retarget-time verification (gh pr view --json closingIssuesReferences, re-save the body if empty). One matching red-flag row for the "no linked PR, the keyword must be wrong" misdiagnosis.Verification (writing-skills RED → GREEN)
Towards-then-upgrade policy and itself flagged its failure mode; the live session'sCloses-from-the-start choice produced user-visible confusion the skill couldn't explain.Closesfrom the start, the correct deferred-not-broken explanation for the missing linkage (declining to "fix" it), and the retarget-timeclosingIssuesReferencescheck with the body re-save fallback.